// 通用响应类型 - 匹配后端BaseResponse
export interface BaseResponse<T = any> {
  code: number
  data: T
  message: string
}

// 兼容性别名
export type ApiResponse<T = any> = BaseResponse<T>

// 分页响应类型
export interface PageResponse<T = any> {
  records: T[]
  total: number
  size: number
  current: number
  pages: number
}

// 用户相关类型
export interface User {
  id: number
  username: string
  email?: string
  avatar?: string
  createTime?: string
  updateTime?: string
}

// 用户视图对象类型 - 匹配后端UserVO
export interface UserVO {
  id: number
  userAccount: string
  userPassword?: string
  phone?: string
  email?: string
  openId?: string
  userName?: string
  userAvatar?: string
  userProfile?: string
  userRole: string
  createTime: string
  vipExpireTime?: string
  vipNumber?: number
}

// 登录请求类型 - 匹配后端UserLoginRequest
export interface LoginRequest {
  userAccount: string
  userPassword: string
}

// Sa-Token信息类型
export interface SaTokenInfo {
  tokenName: string
  tokenValue: string
  isLogin: boolean
  loginId: any
  loginType: string
  tokenTimeout: number
  sessionTimeout: number
  tokenSessionTimeout: number
  tokenActiveTimeout: number
  loginDeviceType: string
  tag: string
}

// 登录响应类型 - 现在返回SaTokenInfo
export interface LoginResponse extends SaTokenInfo {}

// 应用相关类型
export interface App {
  id: number
  appName: string
  description: string
  type: string
  cover?: string
  systemPrompt: string
  fileGenType: string
  priority?: number
  userId: number
  createTime: string
  updateTime: string
  editTime: string
  usesCnt: number
  isDelete: number
}

// 创建应用请求类型 - 匹配后端AppAddRequest
export interface CreateAppRequest {
  appName: string
  cover?: string
  systemPrompt: string
  type: string
  description: string
  fileGenType: string
  priority?: number
}

// 应用分类类型
export interface AppCategory {
  id: number
  name: string
  description?: string
  icon?: string
}

// 应用列表查询参数
export interface AppListParams {
  current?: number
  size?: number
  name?: string
  category?: string
  status?: string
}